package com.fxc;

import java.time.Year;
import java.util.Scanner;
import java.util.zip.ZipEntry;

public class WorkFour {
	public static void main(String[] args) {
		//String string = WaterFlower();
		//System.out.println(string);
		
		rabbit();
	}
	
	/**
	 * 水鲜花
	 */
	public static String WaterFlower() {
		
		Scanner sc = new Scanner(System.in);
			
			int number = sc.nextInt();
			
			if (number < 99 || number > 1000) {
				return "请输入三位数";
			}
			
			int a = number / 100;
			int b = number / 10 %10;
			int c = number %10;
			
			if (a*a*a + b * b * b + c * c * c == number) {
				return "这是一个水鲜花数";
			}
		return "这不是一个水鲜花数";
	}
	
	
	/**
	 * 买兔子问题,小明有100块钱，想买100只兔子，已知公兔子1块钱一只，母兔子2块钱一只，小兔子0.5元一只，

		要求买100只兔子刚好花完100块钱

		请问小明有多少种买法？打印出所有可行方案。
	 */
	public static void rabbit() {
		// 花多少钱
		double money = 100.0;
		
		// 买的总数
		double rabbits = 100.0;
		
		// 兔子的价钱
		double MaleRabbit = 1;
		double FemaleRabbit = 2;
		double LittleRabbit = 0.5;
		
		// 每只兔子的个数
		double M = 0;
		double F = 0;
		double L = 0;
		
		// 方案
		int num = 0;
		for ( M = 0; M <= rabbits; M++) {
			for ( F = 0; F <= rabbits; F++) {
				for ( L = 0; L <=  rabbits; L++) {
					if (((MaleRabbit * M) + (FemaleRabbit * F) + (LittleRabbit * L)) == money && M + F + L == rabbits) {
						System.out.println("方案:" + (++num));
						System.out.println("大兔子：" + M + "只");
						System.out.println("母兔子：" + F + "只");
						System.out.println("小兔子：" + L + "只");
						System.out.println("----------------------------");
					}
				}
			}
		}


	}
}
